//https://leetcode.cn/problems/pascals-triangle/submissions/562133108/
//杨辉三角

class Solution {
public:
    vector<vector<int>> generate(int numRows) {
        vector<vector<int>> ret(numRows);
        for(size_t i = 0; i < numRows; i++)
        {
            ret[i].resize(i + 1, 1);
            for(size_t j = 1; j < ret[i].size() - 1; j++)
            {
                ret[i][j] = ret[i - 1][j] + ret[i - 1][j - 1];
            }
        }

        return ret;
    }
};